Skip to content

Conversation

@Nielio
Copy link

@Nielio Nielio commented Oct 28, 2019

Changed the notation format from functions in attributes, to functinos.
Also corrected some return types.
The most important one: I applied the function documentation from the readme.

Comment on lines +5 to +7
export default class Vec2 {
public readonly x: number;
public readonly y: number;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, remove the readonly from x and y? It produces lint errors when I just want to change a value fast without extra function call

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should stay readonly.
There are no setters implemented. The values are just simple attributes.

If you set the values directly, it would be like calling the set() function with notify = false.
From the docs:

none of the observers will be called.

Also, the internal clean() function would not be called. It validates the values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. Forgot the observers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants